<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    table{
      text-align: center;
    }
  </style>
</head>
<body>
<div>
  {{info}}
  <ul>
    <!-- v-for 循环遍历指令, 遍历同时生成当前元素 -->
    <li v-for="name in arr">{{name}}</li>
  </ul>
  <table border="1">
    <caption style="font-weight: bold">商品列表</caption>
    <tr>
      <th>序号</th>
      <th>品牌</th>
      <th>价格</th>
      <th>数量</th>
    </tr>
    <tr v-for="(p,i) in products">
      <td>{{i+1}}</td>
      <td >{{p.title}}</td>
      <td >{{p.price}}</td>
      <td>{{p.num}}</td>
    </tr>
  </table>
</div>
<script src="js/vue.min.js"></script>
<script>
  let v = new Vue({
    el:"body>div",
    data:{
      info:"循环遍历测试",
      arr:["刘备", "关羽", "张飞"],
      products:[{title:"小米手机", price:"3000", num:100},
        {title:"oppo手机", price:"4000", num:200},
        {title:"华为手机", price:"8000", num:10}]
    }
  })

</script>
</body>
</html>